import request from '@/utils/request'

// 查询river_news列表
export function listRiver_news(query) {
  return request({
    url: '/river_news/river_news/list',
    method: 'get',
    params: query
  })
}

// 查询river_news详细
export function getRiver_news(newsId) {
  return request({
    url: '/river_news/river_news/' + newsId,
    method: 'get'
  })
}

// 新增river_news
export function addRiver_news(data) {
  return request({
    url: '/river_news/river_news',
    method: 'post',
    data: data,
  })
}

// 修改river_news
export function updateRiver_news(data) {
  return request({
    url: '/river_news/river_news',
    method: 'put',
    data: data,
  })
}

// 新增river_news
export function addRiver_newsOwn(data) {
  return request({
    url: '/river_news/river_news/add',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

// 修改river_news
export function updateRiver_newsOwn(data) {
  return request({
    url: '/river_news/river_news/update',
    method: 'put',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

// 删除river_news
export function delRiver_news(newsId) {
  return request({
    url: '/river_news/river_news/' + newsId,
    method: 'delete'
  })
}

export function uploadFile(id, formData) {
  return request({
    url: '/river_news/river_news/filePath/' + id,
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  });
}

// 隐藏河道要闻
export function hideRiverNews(newsId) {
  return request({
    url: '/river_news/river_news/hide/' + newsId,
    method: 'put'
  })
}

// 显示河道要闻
export function showRiverNews(newsId) {
  return request({
    url: '/river_news/river_news/show/' + newsId,
    method: 'put'
  })
}

// 上移河道要闻
export function moveUpRiverNews(newsId) {
  return request({
    url: '/river_news/river_news/moveUp/' + newsId,
    method: 'put'
  })
}

// 下移河道要闻
export function moveDownRiverNews(newsId) {
  return request({
    url: '/river_news/river_news/moveDown/' + newsId,
    method: 'put'
  })
}
